package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.time.LocalDateTime;

@TableName("t_reply")
public class ReplyBean {
    @TableId(value = "pk_replyId", type = IdType.AUTO)
    private Integer id;

    @TableField("r_title")
    private String title;

    @TableField("r_content")
    private String content;

    @TableField("fk_postId")
    private Integer postId;

    @TableField("fk_userId")
    private Integer userId;

    @TableField(exist = false)
    private UserBean userBean;

    @TableField("r_replyDate")
    private LocalDate replyDate = LocalDate.now();


    public ReplyBean() {
    }

    public ReplyBean(String title, String content, Integer postId, Integer userId, UserBean userBean, LocalDate replyDate) {
        this.title = title;
        this.content = content;
        this.postId = postId;
        this.userId = userId;
        this.userBean = userBean;
        this.replyDate = replyDate;
    }

    public ReplyBean(String title, String content, Integer postId, Integer userId) {
        this.title = title;
        this.content = content;
        this.postId = postId;
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "ReplyBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", postId=" + postId +
                ", userId=" + userId +
                ", userBean=" + userBean +
                ", replyDate=" + replyDate +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getPostId() {
        return postId;
    }

    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    public LocalDate getReplyDate() {
        return replyDate;
    }

    public void setReplyDate(LocalDate replyDate) {
        this.replyDate = replyDate;
    }
}